package utils;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class DataWriter {

	private String filename;
	private IDataWriter fileWriter;

	public DataWriter(String filename, IDataWriter fileWriter) {
		this.filename = filename;
		this.fileWriter = fileWriter;

	}

	public void write(String str) {

		try {
			FileWriter writer = new FileWriter(new File(filename));

			writer.write(fileWriter.getLine(str) + "\n");

			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}